﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>小区房屋及人员信息管理终端</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <script type="text/javascript" src="assets/js/jquery.min.js"></script>

   <!--  <link rel="stylesheet" href="assets/css/style.css"> -->
    <link rel="stylesheet" href="assets/css/loader-style.css">
    <link rel="stylesheet" href="assets/css/bootstrap.css">
    <link rel="stylesheet" href="assets/css/signin.css">


    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    <!-- Fav and touch icons -->
    <link rel="shortcut icon" href="assets/ico/minus.png">
</head>

<body>
    <!--预加载程序-->
    <div id="preloader">
        <div id="status">&nbsp;</div>
    </div>
    
    <div class="container">
        <div class="" id="login-wrapper">
            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                    <div id="logo-login">
                        <h3>小区房屋及人员信息管理系统</h3>
                    </div>
                </div>

            </div>

            <div class="row">
                <div class="col-md-4 col-md-offset-4">
                    <div class="account-box"> 
                        <form role="form" action="index.html">
                            <div class="form-group">
                                <label for="inputUsernameEmail">用户名</label>
                                <input type="text" id="inputUsernameEmail" placeholder="Username" value="1" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="inputPassword">密码</label>
                                <input type="password" id="inputPassword" placeholder="Password" value="123456" class="form-control">
                            </div>
                            <div class="checkbox pull-left">
                                <label>
                                    <input type="checkbox">记住用户名</label>
                            </div>
                            <button class="btn btn btn-primary pull-right" type="button" id="login-button" onclick="checkall();">
                                登 录
                            </button>
                        </form>
                        <!--<a class="forgotLnk" href="index.html"></a>-->

                        <div class="row-block">
	                        <div class="row">
		                    </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="test1" class="gmap3"></div>
    <!--纸包装结束-->




    <!--主要效果-->
    <script type="text/javascript" src="assets/js/preloader.js"></script>
    <script type="text/javascript" src="assets/js/bootstrap.js"></script>
    <script type="text/javascript" src="assets/js/app.js"></script>
    <script type="text/javascript" src="assets/js/load.js"></script>
    <script type="text/javascript" src="assets/js/main.js"></script>

    <script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
    <script type="text/javascript" src="assets/js/map/gmap3.js"></script>
    <script type="text/javascript">
    $(function() {

        $("#test1").gmap3({
            marker: {
                latLng: [-7.782893, 110.402645],
                options: {
                    draggable: true
                },
                events: {
                    dragend: function(marker) {
                        $(this).gmap3({
                            getaddress: {
                                latLng: marker.getPosition(),
                                callback: function(results) {
                                    var map = $(this).gmap3("get"),
                                        infowindow = $(this).gmap3({
                                            get: "infowindow"
                                        }),
                                        content = results && results[1] ? results && results[1].formatted_address : "no address";
                                    if (infowindow) {
                                        infowindow.open(map, marker);
                                        infowindow.setContent(content);
                                    } else {
                                        $(this).gmap3({
                                            infowindow: {
                                                anchor: marker,
                                                options: {
                                                    content: content
                                                }
                                            }
                                        });
                                    }
                                }
                            }
                        });
                    }
                }
            },
            map: {
                options: {
                    zoom: 15
                }
            }
        });

    });
    </script>

    <!--请求登录-->
<script src='http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'></script>
<script type="text/javascript">
        function checkall() {
            {
                var inputUsernameEmail = document.getElementById("inputUsernameEmail").value;
                var inputPassword = document.getElementById("inputPassword").value;
                if(inputUsernameEmail == ""){alert("账号不能为空");  return false;}
                if(inputPassword == ""){alert("密码不能为空"); return false;}
                var datas = JSON.stringify({"admin_id": inputUsernameEmail, "admin_password": inputPassword});
                $.ajax({
                    type: 'POST',
                    url: "/Admin/login",
                    data: datas,
                    headers : {
                        'Content-type' : 'application/json;charset=UTF-8'
                    },
                    success: function (data) {
                        var resultanswer = new Array(); //定义一数组 ,用于接受网址和返回的数据
                        resultanswer = data.split(/[,]/);
                        if(resultanswer[0] == "success")
                        {
//                        alert(resultanswer[0]);
//                        alert(resultanswer[1]);
                            window.location.href= resultanswer[1];
//                        window.location.href= "modelpage.jsp";

                        }
                        else
                        {
                            alert(resultanswer[1]);
                        }

                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        return false;
                        alert("出现异常，异常信息：" + textStatus, "error");
                    }
                });
            }
        }

    </script>

</body>

</html>
